//
//  BaseViewController.swift
//  iOS
//
//  Created by gongkai on 15/4/6.
//  Copyright (c) 2015年 moaki. All rights reserved.
//

import UIKit

class BaseViewController: UIViewController,UITextFieldDelegate {
    private var returnKeyHandler : IQKeyboardReturnKeyHandler!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        returnKeyHandler = IQKeyboardReturnKeyHandler(controller: self);
    }

    override func viewWillAppear(animated : Bool) {
        super.viewWillAppear(animated)
        IQKeyboardManager.sharedManager().shouldToolbarUsesTextFieldTintColor = true
        if(key_umeng != ""){
            MobClick.beginLogPageView(self.title == nil ? "unkown" : self.title!)
        }
    }
    
    
    override func viewDidDisappear(animated : Bool) {
        super.viewDidDisappear(animated)
        IQKeyboardManager.sharedManager().shouldToolbarUsesTextFieldTintColor = false
        if(key_umeng != ""){
            MobClick.endLogPageView(self.title == nil ? "unkown" : self.title!)
        }
    }
}
